<!-- 左侧菜单开始 -->
<div class="left-nav" style="overflow: scroll;">
    <div id="side-nav">
        <ul id="nav">
          <li>
            <a href="javascript:;" onclick="$('#dashboard').attr('src', '{*home*}')">
              <i class="layui-icon left-nav-li" lay-tips="{* locale['dashboard.menu.home'] *}">&#xe665;</i>
              <cite>{* locale['dashboard.menu.home'] *}</cite>
            </a>
          </li>
          {% if is_admin then %}
            <li>
              <a href="javascript:;">
                <i class="layui-icon left-nav-li" lay-tips="{* locale['dashboard.menu.system'] *}">&#xe716;</i>
                <cite>{* locale['dashboard.menu.system'] *}</cite>
                <i class="iconfont nav_right">&#xe697;</i>
              </a>
              <ul class="sub-menu">
                <li>
                  <a onclick="xadmin.add_tab('{* locale['dashboard.menu.system.user'] *}','{* user *}',true)">
                    <i class="iconfont" lay-tips="{* locale['dashboard.menu.system.user'] *}">&#xe6b8;</i>
                    <cite>{* locale['dashboard.menu.system.user'] *}</cite>
                  </a>
                </li>
                <li>
                  <a onclick="xadmin.add_tab('{* locale['dashboard.menu.system.role'] *}','{* role *}',true)">
                    <i class="layui-icon">&#xe770;</i><cite>{* locale['dashboard.menu.system.role'] *}</cite>
                  </a>
                </li>
                <li>
                  <a onclick="xadmin.add_tab('{* locale['dashboard.menu.system.header'] *}','{* header *}',true)">
                    <i class="layui-icon">&#xe65f;</i><cite>{* locale['dashboard.menu.system.header'] *}</cite>
                  </a>
                </li>
                <li>
                  <a onclick="xadmin.add_tab('{* locale['dashboard.menu.system.menu'] *}','{* menu *}',true)">
                    <i class="layui-icon">&#xe671;</i><cite>{* locale['dashboard.menu.system.menu'] *}</cite>
                  </a>
                </li>
              </ul>
            </li>
          {% end %}
          {% for _, menu in ipairs(menus) do %}
            <li>
            {% if type(menu[2]) == 'string' then%}
              <a onclick="xadmin.add_tab('{*locale[menu[1]] or menu[1]*}','{*menu[2]*}',true)">
                <i class="layui-icon left-nav-li" lay-tips="{*locale[menu[1]] or menu[1]*}">{*menu[3]*}</i><cite>{*locale[menu[1]] or menu[1]*}</cite>
              </a>
            {% elseif type(menu[2]) == 'table' then %}
              <a href="javascript:;">
                <i class="layui-icon left-nav-li" lay-tips="{*locale[menu[1]] or menu[1]*}">{*menu[3]*}</i>
                <cite>{*locale[menu[1]] or menu[1]*}</cite>
                <i class="iconfont nav_right">&#xe697;</i>
              </a>
              <ul class="sub-menu">
              {% for _, item in ipairs(menu[2]) do %}
                  <li>
                  {% if type(item[2]) == 'table' then%}
                    <a href="javascript:;">
                      <i class="layui-icon">{*item[3]*}</i>
                      <cite>{*locale[item[1]] or item[1]*}</cite>
                      <i class="iconfont nav_right">&#xe697;</i>
                    </a>
                    <ul class="sub-menu">
                    {% for _, it in ipairs(item[2]) do %}
                      <li>
                        <a onclick="xadmin.add_tab('{*locale[it[1]] or it[1]*}','{*it[2]*}',true)">
                          <i class="layui-icon">{*it[3]*}</i>
                          <cite>{*locale[it[1]] or it[1]*}</cite>
                        </a>
                      </li>
                    {% end %}
                    </ul>
                  {% else %}
                    <a onclick="xadmin.add_tab('{*item[1]*}','{*item[2]*}',true)">
                      <i class="layui-icon">{*item[3]*}</i>
                      <cite>{*locale[item[1]] or item[1]*}</cite>
                    </a>
                  {% end %}
                  </li>
              {% end %}
              </ul>
            {% end %}
            </li>
          {% end %}
        </ul>
    </div>
</div>
